import 'package:json_annotation/json_annotation.dart';

part 'address_entity.g.dart';

@JsonSerializable()
class AddressEntity {
  int? total;
  int? pages;
  int? limit;
  int? page;
  List<AddressList>? list;

  AddressEntity({
    this.total,
    this.pages,
    this.limit,
    this.page,
    this.list,
  });

  factory AddressEntity.fromJson(Map<String, dynamic> json) => _$AddressEntityFromJson(json);
  
  Map<String, dynamic> toJson() => _$AddressEntityToJson(this);
}

@JsonSerializable()
class AddressList {
  String? addTime;
  String? city;
  String? county;
  String? updateTime;
  int? userId;
  String? areaCode;
  bool? isDefault;
  String? addressDetail;
  bool? deleted;
  String? province;
  String? name;
  String? tel;
  int? id;

  AddressList({
    this.addTime,
    this.city,
    this.county,
    this.updateTime,
    this.userId,
    this.areaCode,
    this.isDefault,
    this.addressDetail,
    this.deleted,
    this.province,
    this.name,
    this.tel,
    this.id,
  });

  factory AddressList.fromJson(Map<String, dynamic> json) => _$AddressListFromJson(json);
  
  Map<String, dynamic> toJson() => _$AddressListToJson(this);
}